You are here: Symbol Reference > Dew Namespace > Dew.Signal Namespace > Dew.Signal.Units Namespace > Classes > IIRFilters Class > IIRFilters Methods > ChebyshevIIFilter Method > IIRFilters.ChebyshevIIFilter Method (int, double, [In] double[], TFilterType, bool, [In] TMtx, [In] TVec, [In] TVec, out double)
Dew Signal for .NET
ContentsIndexHome
Example

Design a discrete highpass filter with transition band between 10..12 Hz, if the sampling frequency is 30 Hz. The stopband should have more then 50 dB attenuation and the passband should not have more then 0.2dB ripple. This example does not actually filter data. It only designs the filter. To see how to actually apply the filter check the IirInit and IirInitBQ routines. 

 

using Dew.Math; using Dew.Math.Editors; using Dew.Math.Units; using Dew.Signal; using Dew.Signal.Units; using Dew.Math.Tee; using Dew.Signal.Tee; private void button1_Click(object sender, EventArgs e) { Vector z = new Vector(0); Vector p = new Vector(0); Vector num = new Vector(0); Vector den = new Vector(0); Vector Response = new Vector(0); double[] WcArray = new double[1]; int Order; Order = IIRFilters.ChebyshevIIOrder(new double[2] { 10.0*2/30, 12.0*2/30 }, 0.2, 50, TFilterType.ftHighpass, ref WcArray, false); //design analog protype IIRFilters.ChebyshevIIFilter(Order, 50, WcArray, TFilterType.ftHighpass, false, num, den, TIirFrequencyTransform.ftStateSpaceAnalog); SignalUtils.FrequencyResponse(num, den, Response, 32, false, TSignalWindowType.wtRectangular, 0); Vector FreqFr = MtxExpr.Ramp(Response.Length, mvDouble,0, 1.0 / Response.Length); //X axis DrawIt(FreqFr,20*MtxExpr.Log10(MtxExpr.Abs(Response)),"Magnitude",false); }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.